from itsdangerous import TimedJSONWebSignatureSerializer

string = {"number":5}

object = TimedJSONWebSignatureSerializer(secret_key="joke", expires_in=3600*10)

one = object.dumps(string)

print(one)
print(type(one))

two = object.loads(one)

print(two)
print(type(two))